<%@taglib uri="/WEB-INF/struts-html.tld"  prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<u><bean:message key="siswa.siswa"/> <bean:message key="siswa.relasi"/> <bean:message key="label.add"/></u>

<html:form action="siswa.do?action=siswaRelationSave">
    <table cellpadding="1" cellspacing="1" width="100%">
        <tr class="netral">
            <td colspan="2"><bean:message key="siswa.relasi"/></td>
        </tr>
        <tr class="form">
            <td><bean:message key="siswa.nama"/></td>
            <td>: <html:text property="namaRelation" size="50"/></td>
        </tr>
        <tr class="form">
            <td><bean:message key="siswa.umur"/></td>
            <td>: <html:text property="umur" size="10"/></td>
        </tr>
        <tr class="form">
            <td><bean:message key="siswa.relasi"/></td>
            <td>: <html:text property="relasi" size="50"/></td>
        </tr>
        <tr class="form">
            <td colspan="3" align="right"><input type="button" onclick="validate_Relation_form()" value="${buttonAdd}"/></td>
        </tr>
    </table>
</html:form>
<table cellpadding="1" cellspacing="1" width="100%">
    <tr class="netral">
        <td colspan="5"><bean:message key="label.tabel"/> <bean:message key="siswa.relasi"/></td>
    </tr>
    <tr class="header">
        <td><bean:message key="label.no"/></td>
        <td><bean:message key="siswa.nama"/></td>
        <td><bean:message key="siswa.umur"/></td>
        <td><bean:message key="siswa.relasi"/></td>
        <td><bean:message key="label.delete"/></td>
    </tr>
    <c:set var="a" value="${0}"/>
    <logic:notEmpty name="listSiswaRelation">
        <c:forEach var="listSiswaRelation" items="${listSiswaRelation}" varStatus="row">
            <c:if test="${(row.count) % 2 == 0}"><tr class="over"></c:if>
            <c:if test="${(row.count) % 2 != 0}"><tr class="down"></c:if>
                <td width="5%"><c:out value="${row.count}"/></td>
                <td width="60%" align="left"><c:out value="${listSiswaRelation.nama}"/></td>
                <td width="5%"><c:out value="${listSiswaRelation.umur}"/></td>
                <td width="25%" align="left"><c:out value="${listSiswaRelation.relasi}"/></td>
                <td><html:link action="/siswa.do?action=siswaRelationAddDelete" paramName="listSiswaRelation" paramProperty="nama" paramId="nama" styleClass="noLink"><bean:message key="label.yes"/></html:link></td>
            </tr>
        </c:forEach>
    </logic:notEmpty>
    <tr class="form">
        <td colspan="5">&nbsp;</td>
    </tr>
    <logic:empty name="listSiswaRelation">
        <tr class="form">
            <td colspan="5" align="center"><bean:message key="siswa.relasi"/> <bean:message key="label.isEmpty"/></td>
        </tr>
    </logic:empty>
    <tr class="form">
        <td colspan="5" align="right"><html:link href="siswa.do?action=siswaAdd" styleClass="noLink"><input type="button" value="${buttonBack}"/></html:link></td>
    </tr>
</table>